<?php
declare(strict_types=1);

namespace app\common\model;

use think\Model;

class Language extends Model
{
    protected $pk = 'language_id';
    
    protected $autoWriteTimestamp = true;
    
    // 状态获取器
    public function getStatusTextAttr($value, $data)
    {
        $status = [0 => '禁用', 1 => '启用'];
        return $status[$data['status']] ?? '';
    }
    
    // 是否默认语言获取器
    public function getIsDefaultTextAttr($value, $data)
    {
        $status = [0 => '否', 1 => '是'];
        return $status[$data['is_default']] ?? '';
    }
} 